{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

{{#each this.decoratedSource as |item|}}
{{yield (hash
    head=(component "list-accordion/accordion-head"
      isOpen=item.isOpen
      onOpen=(action (queue
        (action (mut item.isOpen) true)
        (action this.onToggle item.item item.isOpen)
      ))
      onClose=(action (queue
        (action (mut item.isOpen) false)
        (action this.onToggle item.item item.isOpen)
      ))
    )
    body=(component "list-accordion/accordion-body" isOpen=item.isOpen)
    item=item.item
    isOpen=item.isOpen
    close=(fn (mut item.isOpen) false)
  )}}
{{/each}}
